home *** CD-ROM | disk | FTP | other *** search
- Path: news.cc.ic.ac.uk!not-for-mail
- From: nagd@doc.ic.ac.uk (Nicholas d'Alterio)
- Newsgroups: comp.lang.c
- Subject: Re: Question!@#!
- Date: 17 Jan 1996 11:12:51 GMT
- Organization: Imperial College, London, UK
- Message-ID: <4diljj$36i@oban.cc.ic.ac.uk>
- References: <4dcejq$2un@venus.senecac.on.ca> <DLBGw1.CpA@news.cern.ch>
- NNTP-Posting-Host: oak48.doc.ic.ac.uk
- X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
-
- Maurizio Loreti (loreti@mxsld2.pd.infn.it) wrote:
- : In article <4dcejq$2un@venus.senecac.on.ca>, you write:
- : >
- : >I have a very Simple question.. well, it should be simple for 'alot' of
- : >you reading this newsgroup..
- : >
- : >anyways.
- : >
- : >I have created a program that asks THE users for his name, then writes it
- : >to a file, the file is called name.txt..
- : >
- : >Evertime this program is executed, the file name.txt get's overwritten.
- : >
- : >How can i keep this file, name.txt, so that i can eventually have a
- : >listing of all users who ran my program???
- : >
- : >Appreciated..
- :
- : A simple solution is to switch to VAX/VMS. A new 'name.txt' file will
- : have a different version number in its file system.
- :
- : :-)
-
- Or if you don't want to switch to an operating system from
- the dark ages you could open the file in append mode.
- e.g
-
- fptr = fopen( "name.txt", "a" );
-
- That way new names are just added to the end of the file
- instead of a new file being created. If the file does
- not exist then it is created.
-
- Nick
-
- --
-
- ~=====================================================~
- Nicholas d'Alterio - Msc student Computing Science
- Imperial College, London
- E-Mail: nagd@ic.ac.uk or daltern@ic.ac.uk (closing)
- http://crab.sp.ph.ic.ac.uk/~projects/nick_gid/nick/
- ~=====================================================~
-